﻿<UserControl x:Class="NoticeModule.Views.NoticeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             mc:Ignorable="d" 
             d:DesignWidth="590">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <i:InvokeCommandAction Command="{Binding LoadCommand}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
    
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!--总颜色样式定义-->
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/Themes/Colors.xaml"/>
                <!--普通按钮样式定义-->
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/ButtonStyle.xaml"/>
                <!--ListBox样式定义-->
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/ListBoxStyle.xaml"/>
                <!--总文字定义-->
                <ResourceDictionary Source="pack://application:,,,/Resources;component/Styles/Themes/Texts.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <XmlDataProvider x:Key="xmlPublish" Source="pack://application:,,,/Games;component/XmlFile/PublishGamesFile.xml" XPath="Data/GameType/Publish"/>
            <XmlDataProvider x:Key="xmlMatch" Source="pack://application:,,,/Games;component/XmlFile/MatchGamesFile.xml" XPath="Data/GameType/Match"/>

        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="300"/>
            <RowDefinition Height="5"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Border Grid.Row="0" BorderBrush="{StaticResource border}" BorderThickness="1" CornerRadius="3" Cursor="Hand">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseLeftButtonDown">
                    <i:InvokeCommandAction Command="{Binding Path=ShowPicCommand}"
                                           CommandParameter="{Binding ElementName=title}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
            
            <Border.Background>
                <ImageBrush ImageSource="{Binding Path=DataContext.ImgSrc,
                                      RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}}}"/>
            </Border.Background>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="42"/>
                    <RowDefinition/>
                    <RowDefinition Height="42"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="65"/>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="65"/>
                </Grid.ColumnDefinitions>
                <Button Grid.Column="0" Grid.Row="1" 
                    Style="{StaticResource picChangeBtnStyle}"
                    Command="{Binding LastCommand}">
                    <Path Stretch="Fill" Height="20" Width="30" Fill="{StaticResource arrow}" Data="F1 M 35.8724,37.6042L 39.0391,40.7708L 50.5182,51.8542L 40.2266,51.8542L 25.1849,37.6041L 40.2266,23.3542L 50.5182,23.3542L 39.0391,34.4375L 35.8724,37.6042 Z "/>
                </Button>
                <Button Grid.Column="2" Grid.Row="1"  
                    Style="{StaticResource picChangeBtnStyle}"
                    Command="{Binding NextCommand}">
                    <Path Stretch="Fill" Height="20" Width="30" Fill="{StaticResource arrow}" Data="F1 M 39.8307,37.6042L 36.6641,34.4375L 25.1849,23.3542L 35.4766,23.3542L 50.5182,37.6042L 35.4766,51.8542L 25.1849,51.8542L 36.6641,40.7708L 39.8307,37.6042 Z "/>
                </Button>
                <Border Grid.Row="3" Grid.ColumnSpan="3" Background="Black" Opacity="0.6" >
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="5"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="1" x:Name="title" Text="{Binding Title}" Tag="{Binding ID}" FontSize="23" Foreground="{StaticResource bg_text}" VerticalAlignment="Center"/>
                    </Grid>
                </Border>
            </Grid>
        </Border>
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="5"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Border Grid.Row="0" BorderBrush="{StaticResource border}" BorderThickness="1" CornerRadius="3" Background="{StaticResource bg_module}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="5"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="5"/>
                    </Grid.RowDefinitions>
                    <!--标题栏-->
                    <Grid Grid.Row="0" Background="{StaticResource tilebtn_bg}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="30"/>
                            <ColumnDefinition Width="1"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Path Grid.Column="0" Height="15" Width="15" Stretch="Fill" Fill="{StaticResource arrow}" Data="F1 M 44.4832,15.8147L 38.0245,32.9939L 37.8017,32.9939L 31.6771,15.8147L 21.7662,21.578L 33.4588,35.6539L 33.4588,35.8755L 16.087,32.3289L 16.087,43.523L 33.5702,40.4197L 33.6815,40.6414L 21.7662,54.4955L 31.343,60.148L 37.6904,43.0797L 37.9131,43.0797L 44.3718,60.148L 54.1713,54.4955L 42.1447,40.7522L 42.1447,40.5305L 60.0713,43.523L 60.0713,32.3289L 42.256,35.8755L 42.256,35.6539L 54.1713,21.4672L 44.4832,15.8147 Z "/>
                        <TextBlock Grid.Column="2" Text="{StaticResource list_publish}" VerticalAlignment="Center" Foreground="{StaticResource bg_text}"/>
                    </Grid>
                    <ListBox  Grid.Row="2" ItemContainerStyle="{StaticResource publishListStyle}"
                         Style="{StaticResource publishListTemplate}"
                         DataContext="{Binding Source={StaticResource xmlPublish}}" ItemsSource="{Binding}" Background="{x:Null}" BorderThickness="0"/>
                </Grid>
            </Border>
            <Border Grid.Row="2" BorderBrush="{StaticResource border}" BorderThickness="1" CornerRadius="3" Background="{StaticResource bg_module}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="5"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="5"/>
                    </Grid.RowDefinitions>
                    <!--标题栏-->
                    <Grid Grid.Row="0" Background="{StaticResource tilebtn_bg}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="30"/>
                            <ColumnDefinition Width="1"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Path Grid.Column="0" Height="15" Width="15" Stretch="Fill" Fill="{StaticResource arrow}" Data="F1 M 37.2083,15.8334C 46.7083,19 35.625,20.5833 41.1667,25.3333L 52.25,25.3334L 52.25,36.4167C 57,41.9584 58.5833,30.875 61.75,40.375C 58.5833,49.875 57,38.7917 52.25,44.3334L 52.25,57L 41.1667,57C 35.625,52.25 46.7083,50.6667 37.2083,47.5C 27.7083,50.6667 38.7917,52.25 33.25,57L 20.5833,57L 20.5833,44.3333C 25.3333,38.7917 26.9167,49.875 30.0833,40.375C 26.9167,30.875 25.3333,41.9583 20.5833,36.4167L 20.5833,25.3333L 33.25,25.3333C 38.7916,20.5833 27.7083,19 37.2083,15.8334 Z "/>
                        <TextBlock Grid.Column="2" Text="{StaticResource list_match}" VerticalAlignment="Center" Foreground="{StaticResource bg_text}"/>
                    </Grid>
                    <ListBox  Grid.Row="2" ItemContainerStyle="{StaticResource matchListStyle}"
                         Style="{StaticResource publishListTemplate}"
                         DataContext="{Binding Source={StaticResource xmlMatch}}" ItemsSource="{Binding}" Background="{x:Null}" BorderThickness="0"/>
                </Grid>
            </Border>
        </Grid>

    </Grid>
        

</UserControl>
